<script lang="ts" setup>
import { computed } from 'vue';

interface TextPriceProps {
    color?: string,
}

const props = withDefaults(defineProps<TextPriceProps>(), {

})

function getColor(value: any) {
    if (value === undefined) return null
    const map: { [index: string]: string } = {
        gray: 'var(--text-gray)'
    }
    return value?.indexOf("#") !== -1 ? value : map[value]
}

const styles = computed(() => {
    return {
        color: getColor(props.color),
    }
})
</script>

<template>
    <umrp-space align="end">
        <umrp-text :style="styles">￥</umrp-text>
        <umrp-text :style="styles">
            <slot></slot>
        </umrp-text>
    </umrp-space>
</template>